package com.qf.service;

import com.qf.dao.UserDao;
import com.qf.dao.UserDaoImpl;

/**
 * @author lixu
 */
public class UserServiceImpl  implements UserService{

    //强耦合
    //private UserDao userDao = new UserDaoImpl();


    //声明  一个接口
    private UserDao userDao;

    //构造器 依赖注入
/*    public UserServiceImpl(UserDao userDao) {
        this.userDao = userDao;
    }*/

    //set方法  依赖注入
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    /**
     * 查询
     */
    public void findUser(){
        System.out.println("我是UserServiceImpl，我要调用下面的");
        userDao.findUser();

    }
}
